<html>
<head>
</head>
<body style="background:white;">
<form method="get">
<select name="f" onchange="this.form.submit()">
<option value=""></option>
<?php
function adir($path){
  $res = "";
  foreach(glob($path.'/*', GLOB_ONLYDIR) as $f) {
    $subres=adir($f);
    if($subres) {
      $res.='<optgroup label="'.htmlentities($f,ENT_QUOTES,'utf-8').'">';
      $res.=$subres;
      $res.='</optgroup>';
    }
  }
  foreach(glob($path.'/*.php') as $f) {
    $res.='<option value="'.htmlentities($f,ENT_QUOTES,'utf-8').'" '.
          (@$_GET["f"]==$f?'selected="selected"':'')
        .'>'.htmlentities($f,ENT_NOQUOTES,'utf-8').'</option>';
  }
  return $res;
}
echo adir("classes");
?>
</select>
</form>
<?php
if(@$_GET["f"]){
  highlight_file($_GET["f"]);
}
?>
</body>
</html>